package com.sinog.biz.service.business.impl;

import com.sinog.biz.mapper.havexml.PrisonerFxMapper;
import com.sinog.biz.service.business.FxxxMainService;
import com.sinog.core.utilbean.Result;
import com.sinog.core.utilbean.ReturnCode;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Map;

/**
 * @desc 获取服刑信息
 * @author sunsf
 * @date 2020-02-07-16:40
 */
@Service
public class FxxxMainServiceImpl implements FxxxMainService {

    @Resource
    private PrisonerFxMapper prisonerFxMapper;

    /**
     * 获取服刑信息
     * @param priNum priNum
     * @return Result
     */
    @Override
    public Result getFxxxInfoByPriNum(String priNum) {
        if(StringUtils.isNotBlank(priNum)) {
            Map<String,String> abp = prisonerFxMapper.getBaseInfoByPriNum(priNum);
            if(MapUtils.isNotEmpty(abp)) {
                return Result.success(abp);
            }
        }
        return Result.failure(ReturnCode.SELECT_FAILED);
    }
}